def Mark(str):
    print("begin")
    while True:
        line=(yield)
        if str in line:
            print(line)

if __name__ == '__main__':
    mark=Mark("Mark")
    mark.next()